package org.openstack.service.resource;

import org.openstack.api.resource.ResourceService;
import org.openstack4j.model.telemetry.Resource;

import java.util.List;

/**
 * Created by jiyun on 2017/8/28.
 */
public class ResourceServiceImpl implements ResourceService {

    private static org.openstack4j.api.telemetry.ResourceService service
            = new org.openstack4j.openstack.telemetry.internal.ResourceServiceImpl();

    /**
     * 获取所有资源列表
     *
     * @return 所有资源列表实例
     */
    @Override
    public List<? extends Resource> getResourceList() {
        return service.list();
    }

    /**
     * 通过资源实例ID获取资源实例
     *
     * @param resourceId 资源ID
     * @return 对应资源实例
     */
    @Override
    public Resource getResourceById(String resourceId) {
        return service.get(resourceId);
    }
}
